package com.ss.android.caijing.stepcounterlib.utils;

import com.ss.android.caijing.stepcounterlib.log.SSLog;

import java.io.File;
import java.io.FileInputStream;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by zdh on 2017/11/10.
 */

public class Util {
    private static String TAG = "Util";
    public static long getTodayTime(){
        Date date = new Date(System.currentTimeMillis());
        try {
            date = SimpleDateFormat.getDateInstance().parse(SimpleDateFormat.getDateInstance().format(date));
        }catch (Exception ex){

        }
        return date.getTime();
    }

    public static long getFileSize(File file) throws Exception
    {
        long size = 0;
        try
        {
            if (file.exists()){
                FileInputStream fis = new FileInputStream(file);
                size = fis.available();
                fis.close();
            }
        }catch (Exception ex){

        }
        return size;
    }
}
